package com.qf.service.impl;

import com.qf.bean.Student;
import com.qf.dao.StudentDao;
import com.qf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * IntelliJ IDEA -> sss1203
 * 2019/12/3 11:37
 *
 * @author zmyao
 * 别看，我是渣渣。
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;
    @Override
    public Page<Student> findStudents(int pageIndex, int pageSize) {
        return studentDao.findAll(new PageRequest(pageIndex-1,pageSize));
    }
}
